package com.yonyou.pmclouds.siteinspection.filter;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * 检查记录测试数据过滤器
 * @author zhangzhonghao
 */
public class SiteInspectionFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        MeasureDataRequestWrapper requestWrapper = new MeasureDataRequestWrapper((HttpServletRequest) request);
        requestWrapper.checkMeasureData();
        chain.doFilter(requestWrapper, response);
    }

    @Override
    public void destroy() {

    }
}
